#ifndef __OPERATIONMODE_CFB_HPP__
#define __OPERATIONMODE_CFB_HPP__

#include "OperationMode.hpp"
#include "Block.hpp"

class OperationMode_CFB : public OperationMode {
	
	private:
		unsigned int j; /**< see lecture slides */
		Block R;

	public:
		/**
		 * @param system encryption system
		 * @param j number of bits of each chunk to be encrypted/decrypted
		 */
		OperationMode_CFB(Algorithm &system, unsigned int j);

		/**
		 * @param system encryption system
		 * @param iv initialization vector
		 * @param j number of bits of each chunk to be encrypted/decrypted
		 */
		OperationMode_CFB(Algorithm &system, const Block &iv, unsigned char j);

		Block encrypt(const Block &plaintext);

		Block decrypt(const Block &ciphertext);

};
#endif

